package javaCode.chapter07.Homework.homework08;

/*
要求：
1、在上面类的基础上扩展 新类CheckingAccount 对每次存款和取款都收取 1美元的手续费
2、扩展前一个练习的BankAccount类 ，新类SavingsAccount 每个月都有利息产生
(earnMonthlyInterest方法被调用)，并且有每三次免手续费的存款或取款。在earnMonthlyInterest方法中重置交易计数
3、体会重写的好处
 */
public class BankAccount {
    private double balance; //余额

    public BankAccount(double balance) {
        this.balance = balance;
    }

    //存款
    public void deposit(double amount){
        balance += amount;
    }

    //取款
    public void withdraw(double amount){
        balance -= amount;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }
}
